package com.pubinfo.passbook.engine.chain.medicine;

import com.pubinfo.passbook.common.model.dto.witeoff.MedicineOnJobOrRetireDTO;
import com.pubinfo.passbook.engine.cache.ComputeCache;
import com.pubinfo.passbook.engine.chain.ComputeNumberChain;
import com.pubinfo.passbook.engine.constants.ComputeChainType;
import lombok.NonNull;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;


/**
 * 医疗费计算链
 *
 * @author zhouch
 * @date 2021/12/13 10:31
 */
public class ComputeMedicineChain extends ComputeNumberChain<MedicineOnJobOrRetireDTO> {

    @Override
    public BigDecimal compute(@NonNull final MedicineOnJobOrRetireDTO data, BigDecimal beforeVal) {
        // 将数据放入缓存
        cache.setMedicineData(data);
        return super.compute(data, beforeVal);
    }

    /**
     * 获取链执行信息
     *
     * @return
     */
    public List<String> getChainExecuteMessage() {
        return cache.getChainExecuteMessage();
    }

    /**
     * 执行compute后, 判断是否需要人工审核
     *
     * @return
     */
    public boolean isNeedAudit() {
        return cache.isNeedAudit();
    }

    @Override
    public String getChainType() {
        return ComputeChainType.MEDICINE;
    }

}
